<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/1.4.8/angular.js"></script>
</head>
<body>
<div ng-controller="myCtrl">
    <div>
        <span>{{result}}</span>
    </div>
    ===============cache==============
    <div>{{cache}}</div>
    <button ng-click="send()">send</button>
</div>
<script type="application/javascript">
    var app = angular.module("app", []);

    app.controller("myCtrl", ["$scope", "$http", "$cacheFactory", function ($scope, $http, $cacheFactory) {
        var objCache = $cacheFactory.get("$http");
        var url = 'http://localhost:8081/open/testC/test.action';
        $scope.result = "";
        $scope.cache = "...";
        $scope.send = function () {
            $http({
                method: "GET",
                url: 'http://localhost:8081/open/testC/test.action',
                cache: true // 开启缓存
            }).success(function (data, status, headers, config) {
                $scope.result = data;
                $scope.cache = "From cache：" + objCache.get(url)[1];
                console.log(objCache.get(url)[0]);
                console.log(objCache.get(url)[1]);
                console.log(objCache.get(url)[2]);
                console.log(objCache.get(url)[3]);
            });
        };
    }]);
</script>
</body>
</html>